<template>
  <section>
    <div>
      <span>
        当前数据源： <Tag color="green">{{ props.data.dsName }} </Tag></span
      >&nbsp;&nbsp;&nbsp;&nbsp;
      <span>
        当前数据库： <Tag color="green"> {{ props.data.databaseName }}</Tag></span
      >
    </div>
    <div>
      <Form layout="inline" :model="formModel">
        <Form.Item label="名称">
          <!-- <a-radio-group v-model:value="formState.layout">
            <a-radio-button value="horizontal">Horizontal</a-radio-button>
            <a-radio-button value="vertical">Vertical</a-radio-button>
            <a-radio-button value="inline">Inline</a-radio-button>
          </a-radio-group> -->
          <Input v-model:value="formModel.name" placeholder="请输入表名" />
        </Form.Item>
        <Form.Item label="引擎">
          <Select v-model:value="formModel.engine" placeholder="请选择引擎">
            <Select.Option value="InnoDB">InnoDB</Select.Option>
            <Select.Option value="MyISAM">MyISAM</Select.Option>
          </Select>
        </Form.Item>

        <Form.Item :wrapper-col="{}">
          <Button type="primary" size="middle">保存</Button>
        </Form.Item>
      </Form>
      <div>
        <FieldList :operator="operatorJsx"/>
      </div>
    </div>
  </section>
</template>

<script lang="tsx" setup>
  import { ref, onMounted, defineProps, reactive } from 'vue';
  import { Tag, Form, Button, Input, Select ,Table } from 'ant-design-vue';
  import FieldList from './FieldList.vue';

  const props = defineProps<{
    data: {
      dsId: number;
      dsName: string;
      databaseName: string;
    };
  }>();

  const formModel = reactive({
    name: '',
    engine: 'InnoDB',
  });

  const operatorJsx = (params: {
    text: string;
    index: number;
    record: any;
}) => {
    return (<div></div>)
  }
</script>

<style lang="less" scoped></style>
